<?php
require_once("functions.php");
session_start();
mysql_select_db($db_baza_date, $baza) or die ('Cannot connect to server! Please retry later!');
set_time_limit (100);
mysql_set_charset('utf8', $baza);

$us = str_replace("|"," ",$_GET['user']);
$na = str_replace("|"," ",$_GET['name']);
$em = str_replace("|"," ",$_GET['email']);


if(!isset($_POST['step']) && !isset($_POST['step2'])) { //daca nu este setat post step si step2

print '<h1> Au fost procesate urmatoarele informatii:</h1>
	<p>Username:'.$us.'</p>
	<p>Nume:'.$na.'</p>
	<p>Email:'.$em.'</p>';
$_SESSION['email'] = $em;
}
if($_POST['step'] == "accept") {
	setAccept($_SESSION['email']);
  }

if($_POST['step2']=="reject")
	reject($_SESSION['email']);

?>

<html>
<head><title>Panou de control</title></head>

<body>
	<form action="<?php print $_SERVER['PHP_SELF']?>" method="POST" >
	<input type="submit" name="step" id="step" value="accept">
	<input type="submit" name="step2" id="step2" value="reject">
	</form>

</body>
</html>